﻿
using hentity;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace hwms {
    /**
   *┌────────────────────────────────────────────────┐
   *│　描    述：ParamRelation                                                    
   *│　作    者：sgj                                              
   *│　版    本：1.0                                              
   *│　创建时间：2021/9/19 8:39:46                        
   *└────────────────────────────────────────────────┘
   **/
    public class ParamRelation {

       
        public List<ParamRelation> relyList = new List<ParamRelation>();
        public int  deep;
        public CoreTaskParam param;
        public List<long> getRelyId() {
            return new List<long>() { param.relyParamId };
        }
        public ParamRelation(CoreTaskParam p) {
            param = p;

        }

        public void addRely(ParamRelation pr) {
            relyList.Add(pr);
        }
        public int getDeep() {

            int d = 0;
            foreach( ParamRelation rely in relyList) {
                d = Math.Max(d ,rely.getDeep());
            }
            return d + 1;
        }


        public bool isStn(int stn) {
            return param.src == stn || param.des == stn;
        }
        
    }
}
